package ThreadStart;

//实现runnerable接口，重写run方法，利用thread调用start开始执行
public class RunnableDemo implements Runnable
{

    public void run()
    {
        System.out.println("子线程");
    }

    public static void main(String[] args)
    {
        //创建对象
        RunnableDemo runnerableDemo =new RunnableDemo();
        //创建线程对象
        Thread thread =new Thread(runnerableDemo);
        //通过线程对象开启线程，【代理】
        thread.start();
        System.out.println("父线程");
    }
}
